
import { IsString, IsNotEmpty, IsEnum, IsOptional } from 'class-validator';
import mongoose from 'mongoose';

export class CreatePermissionDto {
    @IsEnum(['button', 'menu'])
    type!: 'button' | 'menu';
    @IsString()
    @IsNotEmpty()
    name!: string;
    @IsOptional()
    @IsString({ message: '创建人必须是字符串' })
    createdBy!: mongoose.Schema.Types.ObjectId;

}
export class UpdatePermissionDto {
    @IsEnum(['button', 'menu'])
    type!: 'button' | 'menu';
    @IsString()
    @IsNotEmpty()
    name!: string;
    @IsOptional()
    @IsString({ message: '更新人必须是字符串' })
    updatedBy!: mongoose.Schema.Types.ObjectId;
}
